function x = ifct(C)
N=length(C);

V=zeros(1,N);
V(1)=0.5*C(1);
for k=1:N-1
    V(k+1)=0.5*exp(i*2*pi*k/(4*N))*(C(k+1)-i*C(N-k+1));
end
v=real(ifft(V));

n=0;
x=zeros(1,N);
while n<= (N-1)/2
    x(2*n+1)=v(n+1);
    n=n+1;
end
while n<=N-1
    x(2*N-2*n)=v(n+1);
    n=n+1;
end
end